import request from "@/utils/request";

// 查询申请加入列表
export function listTeam(query) {
  return request({
    url: "team/sign/list",
    method: "get",
    params: query,
  });
}

// 查询申请加入详细
export function getTeam(id) {
  return request({
    url: "/system/team/" + id,
    method: "get",
  });
}

// 新增申请加入
export function addTeam(data) {
  return request({
    url: "/system/team",
    method: "post",
    data: data,
  });
}

// 修改申请加入
export function updateTeam(data) {
  return new Promise((resolve, reject) => {
    request({
      url: "/team/sign",
      method: "put",
      data: data,
    }).then((response) => {
        resolve(response);
    }).catch(error => {
        reject(error);
    });
  });
}

// 删除申请加入
export function delTeam(id) {
  return request({
    url: "/system/team/" + id,
    method: "delete",
  });
}
